<template>
    <div>
        <h1>登录</h1>
        <table>
            <tbody>
                <tr>
                    <td>用户名</td>
                    <td><input type="text" v-model="dataa.name"></td>
                </tr>

                <tr>
                    <td>密码</td>
                    <td><input type="text" v-model="dataa.pwd"></td>
                </tr>
                <tr>
                    <td><input type="button" value="登录" @click="Login"></td>
                </tr>
            </tbody>
        </table>
    </div>
</template>
<script setup lang="ts">
import axios from 'axios';
import {ref} from 'vue';


var dataa =  ref({
    name:'',
    pwd:''
})

const Login=()=>{
    axios.get("/api/User/Login",{params:dataa.value}).then(res=>{
        if(res.data.empName==-1)
    {
        alert("用户不对");
        return;
    }
     if(res.data.empName==-2)
    {
        alert("密码不对");
        return;
    }
    else{
         alert("成功");
    }
    })
}

</script>
<style scoped>
</style>